import React,{Component} from 'react';
import {Switch} from 'react-native';

export default class Demo11Component extends Component{
  constructor(){
    super();
    this.state = {
      myValue:false
    };
  }

  //status对应switch开关的true/false
  handleChange=(status)=>{
    this.setState({myValue:status});
  }

  render(){
    return <Switch 
    onValueChange={this.handleChange}
    value={this.state.myValue}></Switch>
  }
}